// TestCaseModel
// (c)2007 Mark Bulmahn. mBulmahn@web.de
// License: GPL 2.0
// Project: TestCaseGenerator. http://www.codeplex.com/TestCaseGenerator

using System;
using System.Collections.Generic;
using System.Text;

namespace TestCaseModel
{
    /// <summary>
    /// A list of several result rules used in a test model.
    /// </summary>
    [Serializable]
    public class ResultRules : List<ResultRule>
    {
        public ResultRules()
        {
        }

        public bool HasResultRule(string ruleName)
        {
            foreach (ResultRule rule in this)
            {
                if (rule.RuleName == ruleName)
                    return true;
            }
            return false;
        }

        public ResultRule GetRuleByName(string ruleName)
        {
            foreach (ResultRule rule in this)
                if (rule.RuleName == ruleName)
                    return rule;
            return null;
        }
    }
}
